//
//  gameOneViewController.m
//  jiejie
//
//  Created by youyoumacmini3 on 17/3/24.
//  Copyright © 2017年 youyoumacmini3. All rights reserved.
//

#import "gameOneViewController.h"

@interface gameOneViewController ()

@property (weak, nonatomic) IBOutlet UIImageView *bgimg;
@end

@implementation gameOneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self choosePayWay];
    self.bgimg.alpha = 0.6;
}

- (void)choosePayWay{
    self.giidBtn.selected = YES;
    [self.giidBtn setBackgroundImage:[UIImage imageNamed:@"x_720"] forState:UIControlStateNormal];
    [self.giidBtn setBackgroundImage:[UIImage imageNamed:@"x_on_720"] forState:UIControlStateSelected];
    [self.giidBtn addTarget:self action:@selector(choosePayWayClick:) forControlEvents:UIControlEventTouchUpInside];
    
    self.badBtn.selected = NO;
    [self.badBtn setBackgroundImage:[UIImage imageNamed:@"x_720"] forState:UIControlStateNormal];
    [self.badBtn setBackgroundImage:[UIImage imageNamed:@"x_on_720"] forState:UIControlStateSelected];
    [self.badBtn addTarget:self action:@selector(choosePayWayClick:) forControlEvents:UIControlEventTouchUpInside];
}

- (void)choosePayWayClick:(UIButton*)button{
    if (button.tag == 222) {
        self.giidBtn.selected = YES;
        self.badBtn.selected = NO;
     
    }else if(button.tag == 111){
        self.badBtn.selected = YES;
        self.giidBtn.selected = NO;
     
        
    }
}
- (IBAction)pay:(id)sender {
    NSURL * url = [NSURL URLWithString:@"weixin://"];
    [[UIApplication sharedApplication] openURL:url];
}
- (IBAction)go:(id)sender {
    [self performSegueWithIdentifier:@"gametwo" sender:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
